<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>编辑角色</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__LAYUI__/css/layui.css" media="all">
  <link rel="stylesheet" href="__CSS__/common/layui.form.css" media="all">
  <link rel="stylesheet" href="__STATIC__/plugs/font-awesome/css/font-awesome.min.css" media="all">
</head>
<body>
    <!--编辑页-->
    <div class="layui-container" style="padding:2%">
        <form class="layui-form" action="{:url('admin/role/edit',array('roleId'=>$info.id))}" method="post">
  			<div class="layui-form-item">
  				<label class="layui-form-label">角色名称</label>
  				<div class="layui-input-block">
  					 <input class="layui-input" type="text" name="roleName"  autocomplete="off" value="{$info.roleName}">
  					 <input type="hidden" name="id" value="{$info.id}">
  				</div>
  			</div>
  			<div class="layui-form-item">
  				<label class="layui-form-label">角色头像</label>
  				<div class="layui-input-block">
  					<div class="layui-upload">
  						 <button type="button" class="layui-btn btn-upload" id="uploadIcon" data-url="{:url('admin/api.upload/upload')}"><i class="fa fa-plus"></i></button>
  						 <div class="layui-upload-list">
  						 	{if $info.roleIcon}
  						 	 <img src="__PUBLIC__{$info.roleIcon}" class="layui-upload-img" id="iconSample">
  						 	 {/if}
  						 	 <input class="layui-hide" type="text" name="roleIcon" value="{$info.roleIcon}">
  						 </div>
  					</div>	
  				</div>
  			</div>
  			<div class="layui-form-item">
  				<label class="layui-form-label">权限</label>
  				<div class="layui-input-block">
  					<ul>
  						{volist name="ruleList.level1" id="level1"}
  							<li>
  								<a href="javascript:;" class="slide" data-number="{$level1.id}" data-type="rule"><i class="fa fa-toggle-right"></i></a>
	  							<input type="checkbox" name="rules[{$level1.id}]" lay-skin="primary" title="{$level1.title}" data-number="{$level1.id}" data-type="rule" {if in_string($level1.id,$info.rules)}checked{/if}>
	  							<dl style="margin-left:20px;"data-pnumber="rule_{$level1.id}" >
	  								{volist name="ruleList.level2" id="level2"}
	  									{if $level2.pid == $level1.id}
	  									<dd>
	  										<a href="javascript:;" class="slide" data-number={$level2.id} data-type="rule"><i class="fa fa-toggle-right"></i></a>
	  										<input type="checkbox" name="rules[{$level2.id}]" lay-skin="primary" title="{$level2.title}" data-number="{$level2.id}" data-type="rule"  {if in_string($level2.id,$info.rules)}checked{/if}>
	  										<dl style="margin-left:40px;"  data-pnumber="rule_{$level2.id}">
		  										{volist name="ruleList.level3" id="level3"}
		  										{if $level3.pid == $level2.id}
		  										<dd style="display:inline">
		  											<input type="checkbox" name="rules[{$level3.id}]" lay-skin="primary" title="{$level3.title}" lay-filter="position" data-number="{$level3.id}" {if in_string($level3.id,$info.rules)}checked{/if}>
		  										</dd>
		  										{/if}
		  										{/volist}
	  										</dl>
	  									</dd>
	  									{/if}
	  								{/volist}
	  							</dl>
  							</li>
  						{/volist}
  					</ul>
  				</div>
  			</div>
  			<!-- <div class="layui-form-item">
  				<label class="layui-form-label">负责区域</label>
  				<div class="layui-input-block">
  					<ul>
  						{volist name="areaList" id="item"}
  							<li>
  								<a href="javascript:;" class="slide" data-number={$item.subsystemNo} data-type="area"><i class="fa fa-toggle-right"></i></a>
	  							<input type="checkbox" name="positionsId[{$item.id}]" lay-skin="primary" title="{$item.subsystemName}" lay-filter="position" data-number={$item.subsystemNo} data-type="area"  {if in_string($item.id,$info.positionsId)}checked{/if}>
  								<dl style="margin-left:18px;" data-pnumber="area_{$item.subsystemNo}">
  									{volist name="item.child" id="child"}
  										<dd style="display:inline;">
  											<input type="checkbox" name="areasId[{$child.id}]" lay-skin="primary" title="{$child.subsystemName}"  {if in_string($child.id,$info.areasId)}checked{/if}>
  										</dd>
  									{/volist}
  								</dl>
  							</li>
  						{/volist}
  					</ul>
  				</div>
  			</div> -->
  			<div class="layui-form-item">
  				<label class="layui-form-label">备注</label>
  				<div class="layui-input-block">	
      				<textarea name="remark" placeholder="请输入内容" class="layui-textarea"></textarea>
  				</div>
  			</div>
			<div class="layui-form-item">
			    <div class="layui-input-block">
			      <button class="layui-btn btn-green" lay-submit="" lay-filter="save">保存</button>
			      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
			    </div>
		  	</div>
        </form>
    </div>
   
    <script type="text/javascript" src="__LAYUI__/layui.js"></script>
    <script type="text/javascript" src="__JS__/admin/role.js"></script>
       

</body>
</html>           

